<?php
	/**
	 * This is a MetaControl class, providing a QForm or QPanel access to event handlers
	 * and QControls to perform the Create, Edit, and Delete functionality
	 * of the Contact class.  This code-generated class
	 * contains all the basic elements to help a QPanel or QForm display an HTML form that can
	 * manipulate a single Contact object.
	 *
	 * To take advantage of some (or all) of these control objects, you
	 * must create a new QForm or QPanel which instantiates a ContactMetaControl
	 * class.
	 *
	 * Any and all changes to this file will be overwritten with any subsequent
	 * code re-generation.
	 *
	 * @package flx_qcubed
	 * @subpackage MetaControls
	 * @property-read Contact $Contact the actual Contact data class being edited
	 * @property QLabel $IdControl
	 * @property-read QLabel $IdLabel
	 * @property QTextBox $StreetControl
	 * @property-read QLabel $StreetLabel
	 * @property QTextBox $StateControl
	 * @property-read QLabel $StateLabel
	 * @property QTextBox $CityControl
	 * @property-read QLabel $CityLabel
	 * @property QTextBox $ZipcodeControl
	 * @property-read QLabel $ZipcodeLabel
	 * @property QTextBox $NotesControl
	 * @property-read QLabel $NotesLabel
	 * @property QTextBox $GoogleMapsUrlControl
	 * @property-read QLabel $GoogleMapsUrlLabel
	 * @property QTextBox $FlickrUrlControl
	 * @property-read QLabel $FlickrUrlLabel
	 * @property QTextBox $FacebookUrlControl
	 * @property-read QLabel $FacebookUrlLabel
	 * @property QTextBox $TwitterUrlControl
	 * @property-read QLabel $TwitterUrlLabel
	 * @property QTextBox $SkypeUrlControl
	 * @property-read QLabel $SkypeUrlLabel
	 * @property QTextBox $MsnUrlControl
	 * @property-read QLabel $MsnUrlLabel
	 * @property QTextBox $GooglePlusUrlControl
	 * @property-read QLabel $GooglePlusUrlLabel
	 * @property QTextBox $LogUserControl
	 * @property-read QLabel $LogUserLabel
	 * @property QDateTimePicker $LogInsertControl
	 * @property-read QLabel $LogInsertLabel
	 * @property QLabel $LogUpdateControl
	 * @property-read QLabel $LogUpdateLabel
	 * @property-read string $TitleVerb a verb indicating whether or not this is being edited or created
	 * @property-read boolean $EditMode a boolean indicating whether or not this is being edited or created
	 */

	class ContactMetaControlGen extends QBaseClass {
		// General Variables
		/**
		 * @var Contact objContact
		 * @access protected
		 */
		protected $objContact;
		/**
		 * @var QForm|QControl objParentObject
		 * @access protected
		 */
		protected $objParentObject;
		/**
		 * @var string strTitleVerb
		 * @access protected
		 */
		protected $strTitleVerb;
		/**
		 * @var boolean blnEditMode
		 * @access protected
		 */
		protected $blnEditMode;

		// Controls that allow the editing of Contact's individual data fields
		/**
		 * @var QLabel lblId
		 * @access protected
		 */
		protected $lblId;
		/**
		 * @var QTextBox txtStreet
		 * @access protected
		 */
		protected $txtStreet;
		/**
		 * @var QTextBox txtState
		 * @access protected
		 */
		protected $txtState;
		/**
		 * @var QTextBox txtCity
		 * @access protected
		 */
		protected $txtCity;
		/**
		 * @var QTextBox txtZipcode
		 * @access protected
		 */
		protected $txtZipcode;
		/**
		 * @var QTextBox txtNotes
		 * @access protected
		 */
		protected $txtNotes;
		/**
		 * @var QTextBox txtGoogleMapsUrl
		 * @access protected
		 */
		protected $txtGoogleMapsUrl;
		/**
		 * @var QTextBox txtFlickrUrl
		 * @access protected
		 */
		protected $txtFlickrUrl;
		/**
		 * @var QTextBox txtFacebookUrl
		 * @access protected
		 */
		protected $txtFacebookUrl;
		/**
		 * @var QTextBox txtTwitterUrl
		 * @access protected
		 */
		protected $txtTwitterUrl;
		/**
		 * @var QTextBox txtSkypeUrl
		 * @access protected
		 */
		protected $txtSkypeUrl;
		/**
		 * @var QTextBox txtMsnUrl
		 * @access protected
		 */
		protected $txtMsnUrl;
		/**
		 * @var QTextBox txtGooglePlusUrl
		 * @access protected
		 */
		protected $txtGooglePlusUrl;
		/**
		 * @var QTextBox txtLogUser
		 * @access protected
		 */
		protected $txtLogUser;
		/**
		 * @var QDateTimePicker calLogInsert
		 * @access protected
		 */
		protected $calLogInsert;
		/**
		 * @var QLabel lblLogUpdate
		 * @access protected
		 */
		protected $lblLogUpdate;

		// Controls that allow the viewing of Contact's individual data fields
		/**
		 * @var QLabel lblStreet
		 * @access protected
		 */
		protected $lblStreet;
		/**
		 * @var QLabel lblState
		 * @access protected
		 */
		protected $lblState;
		/**
		 * @var QLabel lblCity
		 * @access protected
		 */
		protected $lblCity;
		/**
		 * @var QLabel lblZipcode
		 * @access protected
		 */
		protected $lblZipcode;
		/**
		 * @var QLabel lblNotes
		 * @access protected
		 */
		protected $lblNotes;
		/**
		 * @var QLabel lblGoogleMapsUrl
		 * @access protected
		 */
		protected $lblGoogleMapsUrl;
		/**
		 * @var QLabel lblFlickrUrl
		 * @access protected
		 */
		protected $lblFlickrUrl;
		/**
		 * @var QLabel lblFacebookUrl
		 * @access protected
		 */
		protected $lblFacebookUrl;
		/**
		 * @var QLabel lblTwitterUrl
		 * @access protected
		 */
		protected $lblTwitterUrl;
		/**
		 * @var QLabel lblSkypeUrl
		 * @access protected
		 */
		protected $lblSkypeUrl;
		/**
		 * @var QLabel lblMsnUrl
		 * @access protected
		 */
		protected $lblMsnUrl;
		/**
		 * @var QLabel lblGooglePlusUrl
		 * @access protected
		 */
		protected $lblGooglePlusUrl;
		/**
		 * @var QLabel lblLogUser
		 * @access protected
		 */
		protected $lblLogUser;
		/**
		 * @var QLabel lblLogInsert
		 * @access protected
		 */
		protected $lblLogInsert;

		// QListBox Controls (if applicable) to edit Unique ReverseReferences and ManyToMany References

		// QLabel Controls (if applicable) to view Unique ReverseReferences and ManyToMany References


		/**
		 * Main constructor.  Constructor OR static create methods are designed to be called in either
		 * a parent QPanel or the main QForm when wanting to create a
		 * ContactMetaControl to edit a single Contact object within the
		 * QPanel or QForm.
		 *
		 * This constructor takes in a single Contact object, while any of the static
		 * create methods below can be used to construct based off of individual PK ID(s).
		 *
		 * @param mixed $objParentObject QForm or QPanel which will be using this ContactMetaControl
		 * @param Contact $objContact new or existing Contact object
		 */
		 public function __construct($objParentObject, Contact $objContact) {
			// Setup Parent Object (e.g. QForm or QPanel which will be using this ContactMetaControl)
			$this->objParentObject = $objParentObject;

			// Setup linked Contact object
			$this->objContact = $objContact;

			// Figure out if we're Editing or Creating New
			if ($this->objContact->__Restored) {
				$this->strTitleVerb = QApplication::Translate('Edit');
				$this->blnEditMode = true;
			} else {
				$this->strTitleVerb = QApplication::Translate('Create');
				$this->blnEditMode = false;
			}
		 }

		/**
		 * Static Helper Method to Create using PK arguments
		 * You must pass in the PK arguments on an object to load, or leave it blank to create a new one.
		 * If you want to load via QueryString or PathInfo, use the CreateFromQueryString or CreateFromPathInfo
		 * static helper methods.  Finally, specify a CreateType to define whether or not we are only allowed to
		 * edit, or if we are also allowed to create a new one, etc.
		 *
		 * @param mixed $objParentObject QForm or QPanel which will be using this ContactMetaControl
		 * @param integer $intId primary key value
		 * @param QMetaControlCreateType $intCreateType rules governing Contact object creation - defaults to CreateOrEdit
 		 * @return ContactMetaControl
		 */
		public static function Create($objParentObject, $intId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit) {
			// Attempt to Load from PK Arguments
			if (strlen($intId)) {
				$objContact = Contact::Load($intId);

				// Contact was found -- return it!
				if ($objContact)
					return new ContactMetaControl($objParentObject, $objContact);

				// If CreateOnRecordNotFound not specified, throw an exception
				else if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound)
					throw new QCallerException('Could not find a Contact object with PK arguments: ' . $intId);

			// If EditOnly is specified, throw an exception
			} else if ($intCreateType == QMetaControlCreateType::EditOnly)
				throw new QCallerException('No PK arguments specified');

			// If we are here, then we need to create a new record
			return new ContactMetaControl($objParentObject, new Contact());
		}

		/**
		 * Static Helper Method to Create using PathInfo arguments
		 *
		 * @param mixed $objParentObject QForm or QPanel which will be using this ContactMetaControl
		 * @param QMetaControlCreateType $intCreateType rules governing Contact object creation - defaults to CreateOrEdit
		 * @return ContactMetaControl
		 */
		public static function CreateFromPathInfo($objParentObject, $intCreateType = QMetaControlCreateType::CreateOrEdit) {
			$intId = QApplication::PathInfo(0);
			return ContactMetaControl::Create($objParentObject, $intId, $intCreateType);
		}

		/**
		 * Static Helper Method to Create using QueryString arguments
		 *
		 * @param mixed $objParentObject QForm or QPanel which will be using this ContactMetaControl
		 * @param QMetaControlCreateType $intCreateType rules governing Contact object creation - defaults to CreateOrEdit
		 * @return ContactMetaControl
		 */
		public static function CreateFromQueryString($objParentObject, $intCreateType = QMetaControlCreateType::CreateOrEdit) {
			$intId = QApplication::QueryString('intId');
			return ContactMetaControl::Create($objParentObject, $intId, $intCreateType);
		}



		///////////////////////////////////////////////
		// PUBLIC CREATE and REFRESH METHODS
		///////////////////////////////////////////////

		/**
		 * Create and setup QLabel lblId
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblId_Create($strControlId = null) {
			$this->lblId = new QLabel($this->objParentObject, $strControlId);
			$this->lblId->Name = QApplication::Translate('Id');
			if ($this->blnEditMode)
				$this->lblId->Text = $this->objContact->Id;
			else
				$this->lblId->Text = 'N/A';
			return $this->lblId;
		}

		/**
		 * Create and setup QTextBox txtStreet
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtStreet_Create($strControlId = null) {
			$this->txtStreet = new QTextBox($this->objParentObject, $strControlId);
			$this->txtStreet->Name = QApplication::Translate('Street');
			$this->txtStreet->Text = $this->objContact->Street;
			$this->txtStreet->Required = true;
			$this->txtStreet->MaxLength = Contact::StreetMaxLength;
			return $this->txtStreet;
		}

		/**
		 * Create and setup QLabel lblStreet
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblStreet_Create($strControlId = null) {
			$this->lblStreet = new QLabel($this->objParentObject, $strControlId);
			$this->lblStreet->Name = QApplication::Translate('Street');
			$this->lblStreet->Text = $this->objContact->Street;
			$this->lblStreet->Required = true;
			return $this->lblStreet;
		}

		/**
		 * Create and setup QTextBox txtState
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtState_Create($strControlId = null) {
			$this->txtState = new QTextBox($this->objParentObject, $strControlId);
			$this->txtState->Name = QApplication::Translate('State');
			$this->txtState->Text = $this->objContact->State;
			$this->txtState->Required = true;
			$this->txtState->MaxLength = Contact::StateMaxLength;
			return $this->txtState;
		}

		/**
		 * Create and setup QLabel lblState
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblState_Create($strControlId = null) {
			$this->lblState = new QLabel($this->objParentObject, $strControlId);
			$this->lblState->Name = QApplication::Translate('State');
			$this->lblState->Text = $this->objContact->State;
			$this->lblState->Required = true;
			return $this->lblState;
		}

		/**
		 * Create and setup QTextBox txtCity
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtCity_Create($strControlId = null) {
			$this->txtCity = new QTextBox($this->objParentObject, $strControlId);
			$this->txtCity->Name = QApplication::Translate('City');
			$this->txtCity->Text = $this->objContact->City;
			$this->txtCity->Required = true;
			$this->txtCity->MaxLength = Contact::CityMaxLength;
			return $this->txtCity;
		}

		/**
		 * Create and setup QLabel lblCity
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblCity_Create($strControlId = null) {
			$this->lblCity = new QLabel($this->objParentObject, $strControlId);
			$this->lblCity->Name = QApplication::Translate('City');
			$this->lblCity->Text = $this->objContact->City;
			$this->lblCity->Required = true;
			return $this->lblCity;
		}

		/**
		 * Create and setup QTextBox txtZipcode
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtZipcode_Create($strControlId = null) {
			$this->txtZipcode = new QTextBox($this->objParentObject, $strControlId);
			$this->txtZipcode->Name = QApplication::Translate('Zipcode');
			$this->txtZipcode->Text = $this->objContact->Zipcode;
			$this->txtZipcode->Required = true;
			$this->txtZipcode->MaxLength = Contact::ZipcodeMaxLength;
			return $this->txtZipcode;
		}

		/**
		 * Create and setup QLabel lblZipcode
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblZipcode_Create($strControlId = null) {
			$this->lblZipcode = new QLabel($this->objParentObject, $strControlId);
			$this->lblZipcode->Name = QApplication::Translate('Zipcode');
			$this->lblZipcode->Text = $this->objContact->Zipcode;
			$this->lblZipcode->Required = true;
			return $this->lblZipcode;
		}

		/**
		 * Create and setup QTextBox txtNotes
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtNotes_Create($strControlId = null) {
			$this->txtNotes = new QTextBox($this->objParentObject, $strControlId);
			$this->txtNotes->Name = QApplication::Translate('Notes');
			$this->txtNotes->Text = $this->objContact->Notes;
			$this->txtNotes->MaxLength = Contact::NotesMaxLength;
			return $this->txtNotes;
		}

		/**
		 * Create and setup QLabel lblNotes
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblNotes_Create($strControlId = null) {
			$this->lblNotes = new QLabel($this->objParentObject, $strControlId);
			$this->lblNotes->Name = QApplication::Translate('Notes');
			$this->lblNotes->Text = $this->objContact->Notes;
			return $this->lblNotes;
		}

		/**
		 * Create and setup QTextBox txtGoogleMapsUrl
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtGoogleMapsUrl_Create($strControlId = null) {
			$this->txtGoogleMapsUrl = new QTextBox($this->objParentObject, $strControlId);
			$this->txtGoogleMapsUrl->Name = QApplication::Translate('Google Maps Url');
			$this->txtGoogleMapsUrl->Text = $this->objContact->GoogleMapsUrl;
			$this->txtGoogleMapsUrl->MaxLength = Contact::GoogleMapsUrlMaxLength;
			return $this->txtGoogleMapsUrl;
		}

		/**
		 * Create and setup QLabel lblGoogleMapsUrl
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblGoogleMapsUrl_Create($strControlId = null) {
			$this->lblGoogleMapsUrl = new QLabel($this->objParentObject, $strControlId);
			$this->lblGoogleMapsUrl->Name = QApplication::Translate('Google Maps Url');
			$this->lblGoogleMapsUrl->Text = $this->objContact->GoogleMapsUrl;
			return $this->lblGoogleMapsUrl;
		}

		/**
		 * Create and setup QTextBox txtFlickrUrl
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtFlickrUrl_Create($strControlId = null) {
			$this->txtFlickrUrl = new QTextBox($this->objParentObject, $strControlId);
			$this->txtFlickrUrl->Name = QApplication::Translate('Flickr Url');
			$this->txtFlickrUrl->Text = $this->objContact->FlickrUrl;
			$this->txtFlickrUrl->MaxLength = Contact::FlickrUrlMaxLength;
			return $this->txtFlickrUrl;
		}

		/**
		 * Create and setup QLabel lblFlickrUrl
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblFlickrUrl_Create($strControlId = null) {
			$this->lblFlickrUrl = new QLabel($this->objParentObject, $strControlId);
			$this->lblFlickrUrl->Name = QApplication::Translate('Flickr Url');
			$this->lblFlickrUrl->Text = $this->objContact->FlickrUrl;
			return $this->lblFlickrUrl;
		}

		/**
		 * Create and setup QTextBox txtFacebookUrl
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtFacebookUrl_Create($strControlId = null) {
			$this->txtFacebookUrl = new QTextBox($this->objParentObject, $strControlId);
			$this->txtFacebookUrl->Name = QApplication::Translate('Facebook Url');
			$this->txtFacebookUrl->Text = $this->objContact->FacebookUrl;
			$this->txtFacebookUrl->MaxLength = Contact::FacebookUrlMaxLength;
			return $this->txtFacebookUrl;
		}

		/**
		 * Create and setup QLabel lblFacebookUrl
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblFacebookUrl_Create($strControlId = null) {
			$this->lblFacebookUrl = new QLabel($this->objParentObject, $strControlId);
			$this->lblFacebookUrl->Name = QApplication::Translate('Facebook Url');
			$this->lblFacebookUrl->Text = $this->objContact->FacebookUrl;
			return $this->lblFacebookUrl;
		}

		/**
		 * Create and setup QTextBox txtTwitterUrl
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtTwitterUrl_Create($strControlId = null) {
			$this->txtTwitterUrl = new QTextBox($this->objParentObject, $strControlId);
			$this->txtTwitterUrl->Name = QApplication::Translate('Twitter Url');
			$this->txtTwitterUrl->Text = $this->objContact->TwitterUrl;
			$this->txtTwitterUrl->MaxLength = Contact::TwitterUrlMaxLength;
			return $this->txtTwitterUrl;
		}

		/**
		 * Create and setup QLabel lblTwitterUrl
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblTwitterUrl_Create($strControlId = null) {
			$this->lblTwitterUrl = new QLabel($this->objParentObject, $strControlId);
			$this->lblTwitterUrl->Name = QApplication::Translate('Twitter Url');
			$this->lblTwitterUrl->Text = $this->objContact->TwitterUrl;
			return $this->lblTwitterUrl;
		}

		/**
		 * Create and setup QTextBox txtSkypeUrl
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtSkypeUrl_Create($strControlId = null) {
			$this->txtSkypeUrl = new QTextBox($this->objParentObject, $strControlId);
			$this->txtSkypeUrl->Name = QApplication::Translate('Skype Url');
			$this->txtSkypeUrl->Text = $this->objContact->SkypeUrl;
			$this->txtSkypeUrl->MaxLength = Contact::SkypeUrlMaxLength;
			return $this->txtSkypeUrl;
		}

		/**
		 * Create and setup QLabel lblSkypeUrl
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblSkypeUrl_Create($strControlId = null) {
			$this->lblSkypeUrl = new QLabel($this->objParentObject, $strControlId);
			$this->lblSkypeUrl->Name = QApplication::Translate('Skype Url');
			$this->lblSkypeUrl->Text = $this->objContact->SkypeUrl;
			return $this->lblSkypeUrl;
		}

		/**
		 * Create and setup QTextBox txtMsnUrl
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtMsnUrl_Create($strControlId = null) {
			$this->txtMsnUrl = new QTextBox($this->objParentObject, $strControlId);
			$this->txtMsnUrl->Name = QApplication::Translate('Msn Url');
			$this->txtMsnUrl->Text = $this->objContact->MsnUrl;
			$this->txtMsnUrl->MaxLength = Contact::MsnUrlMaxLength;
			return $this->txtMsnUrl;
		}

		/**
		 * Create and setup QLabel lblMsnUrl
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblMsnUrl_Create($strControlId = null) {
			$this->lblMsnUrl = new QLabel($this->objParentObject, $strControlId);
			$this->lblMsnUrl->Name = QApplication::Translate('Msn Url');
			$this->lblMsnUrl->Text = $this->objContact->MsnUrl;
			return $this->lblMsnUrl;
		}

		/**
		 * Create and setup QTextBox txtGooglePlusUrl
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtGooglePlusUrl_Create($strControlId = null) {
			$this->txtGooglePlusUrl = new QTextBox($this->objParentObject, $strControlId);
			$this->txtGooglePlusUrl->Name = QApplication::Translate('Google Plus Url');
			$this->txtGooglePlusUrl->Text = $this->objContact->GooglePlusUrl;
			$this->txtGooglePlusUrl->MaxLength = Contact::GooglePlusUrlMaxLength;
			return $this->txtGooglePlusUrl;
		}

		/**
		 * Create and setup QLabel lblGooglePlusUrl
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblGooglePlusUrl_Create($strControlId = null) {
			$this->lblGooglePlusUrl = new QLabel($this->objParentObject, $strControlId);
			$this->lblGooglePlusUrl->Name = QApplication::Translate('Google Plus Url');
			$this->lblGooglePlusUrl->Text = $this->objContact->GooglePlusUrl;
			return $this->lblGooglePlusUrl;
		}

		/**
		 * Create and setup QTextBox txtLogUser
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtLogUser_Create($strControlId = null) {
			$this->txtLogUser = new QTextBox($this->objParentObject, $strControlId);
			$this->txtLogUser->Name = QApplication::Translate('Log User');
			$this->txtLogUser->Text = $this->objContact->LogUser;
			$this->txtLogUser->MaxLength = Contact::LogUserMaxLength;
			return $this->txtLogUser;
		}

		/**
		 * Create and setup QLabel lblLogUser
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblLogUser_Create($strControlId = null) {
			$this->lblLogUser = new QLabel($this->objParentObject, $strControlId);
			$this->lblLogUser->Name = QApplication::Translate('Log User');
			$this->lblLogUser->Text = $this->objContact->LogUser;
			return $this->lblLogUser;
		}

		/**
		 * Create and setup QDateTimePicker calLogInsert
		 * @param string $strControlId optional ControlId to use
		 * @return QDateTimePicker
		 */
		public function calLogInsert_Create($strControlId = null) {
			$this->calLogInsert = new QDateTimePicker($this->objParentObject, $strControlId);
			$this->calLogInsert->Name = QApplication::Translate('Log Insert');
			$this->calLogInsert->DateTime = $this->objContact->LogInsert;
			$this->calLogInsert->DateTimePickerType = QDateTimePickerType::DateTime;
			return $this->calLogInsert;
		}

		/**
		 * Create and setup QLabel lblLogInsert
		 * @param string $strControlId optional ControlId to use
		 * @param string $strDateTimeFormat optional DateTimeFormat to use
		 * @return QLabel
		 */
		public function lblLogInsert_Create($strControlId = null, $strDateTimeFormat = null) {
			$this->lblLogInsert = new QLabel($this->objParentObject, $strControlId);
			$this->lblLogInsert->Name = QApplication::Translate('Log Insert');
			$this->strLogInsertDateTimeFormat = $strDateTimeFormat;
			$this->lblLogInsert->Text = sprintf($this->objContact->LogInsert) ? $this->objContact->LogInsert->qFormat($this->strLogInsertDateTimeFormat) : null;
			return $this->lblLogInsert;
		}

		protected $strLogInsertDateTimeFormat;


		/**
		 * Create and setup QLabel lblLogUpdate
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblLogUpdate_Create($strControlId = null) {
			$this->lblLogUpdate = new QLabel($this->objParentObject, $strControlId);
			$this->lblLogUpdate->Name = QApplication::Translate('Log Update');
			if ($this->blnEditMode)
				$this->lblLogUpdate->Text = $this->objContact->LogUpdate;
			else
				$this->lblLogUpdate->Text = 'N/A';
			return $this->lblLogUpdate;
		}



		/**
		 * Refresh this MetaControl with Data from the local Contact object.
		 * @param boolean $blnReload reload Contact from the database
		 * @return void
		 */
		public function Refresh($blnReload = false) {
			if ($blnReload)
				$this->objContact->Reload();

			if ($this->lblId) if ($this->blnEditMode) $this->lblId->Text = $this->objContact->Id;

			if ($this->txtStreet) $this->txtStreet->Text = $this->objContact->Street;
			if ($this->lblStreet) $this->lblStreet->Text = $this->objContact->Street;

			if ($this->txtState) $this->txtState->Text = $this->objContact->State;
			if ($this->lblState) $this->lblState->Text = $this->objContact->State;

			if ($this->txtCity) $this->txtCity->Text = $this->objContact->City;
			if ($this->lblCity) $this->lblCity->Text = $this->objContact->City;

			if ($this->txtZipcode) $this->txtZipcode->Text = $this->objContact->Zipcode;
			if ($this->lblZipcode) $this->lblZipcode->Text = $this->objContact->Zipcode;

			if ($this->txtNotes) $this->txtNotes->Text = $this->objContact->Notes;
			if ($this->lblNotes) $this->lblNotes->Text = $this->objContact->Notes;

			if ($this->txtGoogleMapsUrl) $this->txtGoogleMapsUrl->Text = $this->objContact->GoogleMapsUrl;
			if ($this->lblGoogleMapsUrl) $this->lblGoogleMapsUrl->Text = $this->objContact->GoogleMapsUrl;

			if ($this->txtFlickrUrl) $this->txtFlickrUrl->Text = $this->objContact->FlickrUrl;
			if ($this->lblFlickrUrl) $this->lblFlickrUrl->Text = $this->objContact->FlickrUrl;

			if ($this->txtFacebookUrl) $this->txtFacebookUrl->Text = $this->objContact->FacebookUrl;
			if ($this->lblFacebookUrl) $this->lblFacebookUrl->Text = $this->objContact->FacebookUrl;

			if ($this->txtTwitterUrl) $this->txtTwitterUrl->Text = $this->objContact->TwitterUrl;
			if ($this->lblTwitterUrl) $this->lblTwitterUrl->Text = $this->objContact->TwitterUrl;

			if ($this->txtSkypeUrl) $this->txtSkypeUrl->Text = $this->objContact->SkypeUrl;
			if ($this->lblSkypeUrl) $this->lblSkypeUrl->Text = $this->objContact->SkypeUrl;

			if ($this->txtMsnUrl) $this->txtMsnUrl->Text = $this->objContact->MsnUrl;
			if ($this->lblMsnUrl) $this->lblMsnUrl->Text = $this->objContact->MsnUrl;

			if ($this->txtGooglePlusUrl) $this->txtGooglePlusUrl->Text = $this->objContact->GooglePlusUrl;
			if ($this->lblGooglePlusUrl) $this->lblGooglePlusUrl->Text = $this->objContact->GooglePlusUrl;

			if ($this->txtLogUser) $this->txtLogUser->Text = $this->objContact->LogUser;
			if ($this->lblLogUser) $this->lblLogUser->Text = $this->objContact->LogUser;

			if ($this->calLogInsert) $this->calLogInsert->DateTime = $this->objContact->LogInsert;
			if ($this->lblLogInsert) $this->lblLogInsert->Text = sprintf($this->objContact->LogInsert) ? $this->objContact->LogInsert->qFormat($this->strLogInsertDateTimeFormat) : null;

			if ($this->lblLogUpdate) if ($this->blnEditMode) $this->lblLogUpdate->Text = $this->objContact->LogUpdate;

		}



		///////////////////////////////////////////////
		// PROTECTED UPDATE METHODS for ManyToManyReferences (if any)
		///////////////////////////////////////////////





		///////////////////////////////////////////////
		// PUBLIC CONTACT OBJECT MANIPULATORS
		///////////////////////////////////////////////

		/**
		 * This will save this object's Contact instance,
		 * updating only the fields which have had a control created for it.
		 */
		public function SaveContact() {
			try {
				// Update any fields for controls that have been created
				if ($this->txtStreet) $this->objContact->Street = $this->txtStreet->Text;
				if ($this->txtState) $this->objContact->State = $this->txtState->Text;
				if ($this->txtCity) $this->objContact->City = $this->txtCity->Text;
				if ($this->txtZipcode) $this->objContact->Zipcode = $this->txtZipcode->Text;
				if ($this->txtNotes) $this->objContact->Notes = $this->txtNotes->Text;
				if ($this->txtGoogleMapsUrl) $this->objContact->GoogleMapsUrl = $this->txtGoogleMapsUrl->Text;
				if ($this->txtFlickrUrl) $this->objContact->FlickrUrl = $this->txtFlickrUrl->Text;
				if ($this->txtFacebookUrl) $this->objContact->FacebookUrl = $this->txtFacebookUrl->Text;
				if ($this->txtTwitterUrl) $this->objContact->TwitterUrl = $this->txtTwitterUrl->Text;
				if ($this->txtSkypeUrl) $this->objContact->SkypeUrl = $this->txtSkypeUrl->Text;
				if ($this->txtMsnUrl) $this->objContact->MsnUrl = $this->txtMsnUrl->Text;
				if ($this->txtGooglePlusUrl) $this->objContact->GooglePlusUrl = $this->txtGooglePlusUrl->Text;
				if ($this->txtLogUser) $this->objContact->LogUser = $this->txtLogUser->Text;
				if ($this->calLogInsert) $this->objContact->LogInsert = $this->calLogInsert->DateTime;

				// Update any UniqueReverseReferences (if any) for controls that have been created for it

				// Save the Contact object
				$this->objContact->Save();

				// Finally, update any ManyToManyReferences (if any)
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
		}

		/**
		 * This will DELETE this object's Contact instance from the database.
		 * It will also unassociate itself from any ManyToManyReferences.
		 */
		public function DeleteContact() {
			$this->objContact->Delete();
		}



		///////////////////////////////////////////////
		// PUBLIC GETTERS and SETTERS
		///////////////////////////////////////////////

		/**
		 * Override method to perform a property "Get"
		 * This will get the value of $strName
		 *
		 * @param string $strName Name of the property to get
		 * @return mixed
		 */
		public function __get($strName) {
			switch ($strName) {
				// General MetaControlVariables
				case 'Contact': return $this->objContact;
				case 'TitleVerb': return $this->strTitleVerb;
				case 'EditMode': return $this->blnEditMode;

				// Controls that point to Contact fields -- will be created dynamically if not yet created
				case 'IdControl':
					if (!$this->lblId) return $this->lblId_Create();
					return $this->lblId;
				case 'IdLabel':
					if (!$this->lblId) return $this->lblId_Create();
					return $this->lblId;
				case 'StreetControl':
					if (!$this->txtStreet) return $this->txtStreet_Create();
					return $this->txtStreet;
				case 'StreetLabel':
					if (!$this->lblStreet) return $this->lblStreet_Create();
					return $this->lblStreet;
				case 'StateControl':
					if (!$this->txtState) return $this->txtState_Create();
					return $this->txtState;
				case 'StateLabel':
					if (!$this->lblState) return $this->lblState_Create();
					return $this->lblState;
				case 'CityControl':
					if (!$this->txtCity) return $this->txtCity_Create();
					return $this->txtCity;
				case 'CityLabel':
					if (!$this->lblCity) return $this->lblCity_Create();
					return $this->lblCity;
				case 'ZipcodeControl':
					if (!$this->txtZipcode) return $this->txtZipcode_Create();
					return $this->txtZipcode;
				case 'ZipcodeLabel':
					if (!$this->lblZipcode) return $this->lblZipcode_Create();
					return $this->lblZipcode;
				case 'NotesControl':
					if (!$this->txtNotes) return $this->txtNotes_Create();
					return $this->txtNotes;
				case 'NotesLabel':
					if (!$this->lblNotes) return $this->lblNotes_Create();
					return $this->lblNotes;
				case 'GoogleMapsUrlControl':
					if (!$this->txtGoogleMapsUrl) return $this->txtGoogleMapsUrl_Create();
					return $this->txtGoogleMapsUrl;
				case 'GoogleMapsUrlLabel':
					if (!$this->lblGoogleMapsUrl) return $this->lblGoogleMapsUrl_Create();
					return $this->lblGoogleMapsUrl;
				case 'FlickrUrlControl':
					if (!$this->txtFlickrUrl) return $this->txtFlickrUrl_Create();
					return $this->txtFlickrUrl;
				case 'FlickrUrlLabel':
					if (!$this->lblFlickrUrl) return $this->lblFlickrUrl_Create();
					return $this->lblFlickrUrl;
				case 'FacebookUrlControl':
					if (!$this->txtFacebookUrl) return $this->txtFacebookUrl_Create();
					return $this->txtFacebookUrl;
				case 'FacebookUrlLabel':
					if (!$this->lblFacebookUrl) return $this->lblFacebookUrl_Create();
					return $this->lblFacebookUrl;
				case 'TwitterUrlControl':
					if (!$this->txtTwitterUrl) return $this->txtTwitterUrl_Create();
					return $this->txtTwitterUrl;
				case 'TwitterUrlLabel':
					if (!$this->lblTwitterUrl) return $this->lblTwitterUrl_Create();
					return $this->lblTwitterUrl;
				case 'SkypeUrlControl':
					if (!$this->txtSkypeUrl) return $this->txtSkypeUrl_Create();
					return $this->txtSkypeUrl;
				case 'SkypeUrlLabel':
					if (!$this->lblSkypeUrl) return $this->lblSkypeUrl_Create();
					return $this->lblSkypeUrl;
				case 'MsnUrlControl':
					if (!$this->txtMsnUrl) return $this->txtMsnUrl_Create();
					return $this->txtMsnUrl;
				case 'MsnUrlLabel':
					if (!$this->lblMsnUrl) return $this->lblMsnUrl_Create();
					return $this->lblMsnUrl;
				case 'GooglePlusUrlControl':
					if (!$this->txtGooglePlusUrl) return $this->txtGooglePlusUrl_Create();
					return $this->txtGooglePlusUrl;
				case 'GooglePlusUrlLabel':
					if (!$this->lblGooglePlusUrl) return $this->lblGooglePlusUrl_Create();
					return $this->lblGooglePlusUrl;
				case 'LogUserControl':
					if (!$this->txtLogUser) return $this->txtLogUser_Create();
					return $this->txtLogUser;
				case 'LogUserLabel':
					if (!$this->lblLogUser) return $this->lblLogUser_Create();
					return $this->lblLogUser;
				case 'LogInsertControl':
					if (!$this->calLogInsert) return $this->calLogInsert_Create();
					return $this->calLogInsert;
				case 'LogInsertLabel':
					if (!$this->lblLogInsert) return $this->lblLogInsert_Create();
					return $this->lblLogInsert;
				case 'LogUpdateControl':
					if (!$this->lblLogUpdate) return $this->lblLogUpdate_Create();
					return $this->lblLogUpdate;
				case 'LogUpdateLabel':
					if (!$this->lblLogUpdate) return $this->lblLogUpdate_Create();
					return $this->lblLogUpdate;
				default:
					try {
						return parent::__get($strName);
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}
			}
		}

		/**
		 * Override method to perform a property "Set"
		 * This will set the property $strName to be $mixValue
		 *
		 * @param string $strName Name of the property to set
		 * @param string $mixValue New value of the property
		 * @return mixed
		 */
		public function __set($strName, $mixValue) {
			try {
				switch ($strName) {
					// Controls that point to Contact fields
					case 'IdControl':
						return ($this->lblId = QType::Cast($mixValue, 'QControl'));
					case 'StreetControl':
						return ($this->txtStreet = QType::Cast($mixValue, 'QControl'));
					case 'StateControl':
						return ($this->txtState = QType::Cast($mixValue, 'QControl'));
					case 'CityControl':
						return ($this->txtCity = QType::Cast($mixValue, 'QControl'));
					case 'ZipcodeControl':
						return ($this->txtZipcode = QType::Cast($mixValue, 'QControl'));
					case 'NotesControl':
						return ($this->txtNotes = QType::Cast($mixValue, 'QControl'));
					case 'GoogleMapsUrlControl':
						return ($this->txtGoogleMapsUrl = QType::Cast($mixValue, 'QControl'));
					case 'FlickrUrlControl':
						return ($this->txtFlickrUrl = QType::Cast($mixValue, 'QControl'));
					case 'FacebookUrlControl':
						return ($this->txtFacebookUrl = QType::Cast($mixValue, 'QControl'));
					case 'TwitterUrlControl':
						return ($this->txtTwitterUrl = QType::Cast($mixValue, 'QControl'));
					case 'SkypeUrlControl':
						return ($this->txtSkypeUrl = QType::Cast($mixValue, 'QControl'));
					case 'MsnUrlControl':
						return ($this->txtMsnUrl = QType::Cast($mixValue, 'QControl'));
					case 'GooglePlusUrlControl':
						return ($this->txtGooglePlusUrl = QType::Cast($mixValue, 'QControl'));
					case 'LogUserControl':
						return ($this->txtLogUser = QType::Cast($mixValue, 'QControl'));
					case 'LogInsertControl':
						return ($this->calLogInsert = QType::Cast($mixValue, 'QControl'));
					case 'LogUpdateControl':
						return ($this->lblLogUpdate = QType::Cast($mixValue, 'QControl'));
					default:
						return parent::__set($strName, $mixValue);
				}
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
		}
	}
?>